Under wayland, the compositor doesn't have a 'overall window alpha'
knob, we just need to add the alpha to the buffers we send.
Client-side alpha, if you want to call it that.
Implement this by reusing the existing alpha support for non-toplevel
widgets. As a side-effect of the implementation, windows with RGBA
visual under X will now also use per-pixel alpha, instead of
overall alpha.
cairo_save (cr);
push_group =
- (widget->priv->alpha != 255 &&
- !gtk_widget_is_toplevel (widget));
+ widget->priv->alpha != 255 &&
+ (!gtk_widget_is_toplevel (widget) ||
+ gtk_widget_get_visual (widget) == gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)));
if (push_group)
cairo_push_group (cr);
if (gtk_widget_get_realized (widget))
{
- if (gtk_widget_is_toplevel (widget))
+ if (gtk_widget_is_toplevel (widget) &&
+ gtk_widget_get_visual (widget) != gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)))
gdk_window_set_opacity (priv->window, priv->alpha / 255.0);
gtk_widget_queue_draw (widget);
is_opaque = (color->alpha >= 1.0);
}
+ if (gtk_widget_get_opacity (widget) < 1.0)
+ is_opaque = FALSE;
+
if (is_opaque)
{
cairo_rectangle_int_t rect;